package com.xiaocheng.core.visitor.impl;

import com.xiaocheng.core.visitor.VisitorInterface;

public class SchoolMaster implements VisitorInterface {
	private double totelAmount;
	
	private double ologyAmount;

	@Override
	public void view(MathBook mathBook) {
		this.totelAmount += mathBook.getPrice();
	}

	@Override
	public void view(OlogyBook ology) {
		this.ologyAmount += ology.getPrice();
	}

	public double getTotelAmount() {
		System.out.println(totelAmount);
		return totelAmount;
	}

	public double getOlogyAmount() {
		System.out.println(ologyAmount);
		return ologyAmount;
	}

}
